// ignore_for_file: prefer_const_constructors

import 'package:flutter/material.dart';
import 'package:flutter_vant/main.dart';
import 'package:simulator/pages/actionSheet/index.dart';
import 'package:simulator/pages/button/index.dart';
import 'package:simulator/pages/cell/index.dart';
import 'package:simulator/pages/home/index.dart';
import 'package:simulator/pages/notify/index.dart';
import 'package:simulator/pages/overlay/index.dart';
import 'package:simulator/pages/passwordInput/index.dart';
import 'package:simulator/pages/popup/index.dart';
import 'package:simulator/pages/tab/index.dart';
import 'package:simulator/pages/toast/index.dart';

class RouterConfig extends HookWidget {
  const RouterConfig({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    getRouterConfig() {
      return {
        '/home': (BuildContext context) => Home(),
        '/button': (BuildContext context) => ButtonView(),
        '/cell': (BuildContext context) => Cell(),
        '/tab': (BuildContext context) => TabView(),
        '/popup': (BuildContext context) => PopupView(),
        '/notify': (BuildContext context) => NotifyView(),
        '/overlay': (BuildContext context) => OverlayView(),
        '/actionSheet': (BuildContext context) => ActionSheetView(),
        '/toast': (BuildContext context) => ToastView(),
        '/passwordInput': (BuildContext context) => PasswordInputView(),
      };
    }

    return ScreenUtilInit(
        designSize: const Size(360, 690),
        builder: (
          BuildContext context,
        ) =>
            MaterialApp(
              // home: Home(),
              routes: getRouterConfig(),
              builder: (context, widget) {
                ScreenUtil.setContext(context);
                return MediaQuery(
                  data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
                  child: widget!,
                );
              },
              initialRoute: '/home',
            ));
  }
}
